package c_observer.c_java_observer;

/**
 * Created by wug on 2016/6/17 0017.
 */
public class MainTest {
    public static void main(String[] args) {
        SubjectCar subjectCar = new SubjectCar();
        ObserverCarMonitor observerCarMonitor = new ObserverCarMonitor();
        ObserverStatistics observerStatistics = new ObserverStatistics();
        subjectCar.addObserver(observerCarMonitor);
        subjectCar.addObserver(observerStatistics);
        for (int i = 0; i < 10; i++) {
            try {
                Thread.sleep(1000L);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            subjectCar.carController();
        }
    }
}
